package it.koutifaris.travianmap.dal.sqlservices.travianserver;

import it.koutifaris.travianmap.dal.TravianServerSettingsService.TravianServerSettings;

public class TravianServerSettingsBuilder {

	private TravianServerSettingsBuilder() {
	}

	public static Builder settingsBuilder() {
		return new InternalBuilder();
	}

	public interface Builder {
		Setp2 setServer(String server);
	}

	public interface Setp2 {
		Step3 setAutoUpdate(boolean autoUpdate);
	}

	public interface Step3 {
		StepBuild setWifiOnly(boolean wifiOnly);
	}

	public interface StepBuild {
		TravianServerSettings build();
	}

	private static class InternalBuilder implements Builder, Setp2, Step3, StepBuild {

		private boolean autoUpdate;
		private boolean wifiOnly;
		private String server;

		@Override
		public StepBuild setWifiOnly(boolean wifiOnly) {
			this.wifiOnly = wifiOnly;
			return this;
		}

		@Override
		public Step3 setAutoUpdate(boolean autoUpdate) {
			this.autoUpdate = autoUpdate;
			return this;
		}

		@Override
		public Setp2 setServer(String server) {
			this.server = server;
			return this;
		}

		@Override
		public TravianServerSettings build() {
			return new TravianServerSettingsImpl(server, autoUpdate, wifiOnly);
		}

	}
}
